//
//  BannerView.h
//  bannerViewTest
//
//  Created by 谢特 on 2017/5/16.
//  Copyright © 2017年 xiete. All rights reserved.
//

#import <UIKit/UIKit.h>


@class XTBannerView;
@protocol XTBannerViewDelegate <NSObject>

@optional
/**
 * 点击当前显示图片
 */
- (void)bannerView:(XTBannerView *)bannerView didSelectItemAtIndexPath:(NSInteger)index;

@end

@interface XTBannerView : UIView

+ (instancetype)initBannaerViewWithImags:(NSArray *)imageNames WithFrame:(CGRect)frame;

@property (nonatomic, weak) id <XTBannerViewDelegate> delegate;

/**
 *图片数据源
 */
@property (nonatomic,strong) NSArray *images;

/**
 *占位图
 */
@property (nonatomic, strong) NSString *placeholderImage;

/**
 *是否需要循环滑动 
 */
@property (nonatomic, assign) BOOL needCycle;

/**
 *自动滚动时间
 */
@property (nonatomic, assign) NSTimeInterval scrollTime; //设置则开启循环滑动和自动滚动

/**
 *是否开反弹
 */
@property (nonatomic, assign) BOOL bounces;   //默认关闭

/**
 *当前显示页的位置
 */
@property (nonatomic, assign, readonly) NSInteger currentIndexPage;

/**
 *滑动到指定位置
 */
- (void)scrollToPageOfIndex:(NSInteger)pageIndex Animation:(BOOL)animation;
@end
